package servlet;

import dao.CourseDao;
import dao.StudentDao;
import vo.Course;
import vo.Student;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

/**
 * Created by ssw on 2018/6/16.
 */
public class AskStudentsServlet  extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        StudentDao studentDao =new StudentDao();
        String clname=req.getParameter("clname");
        List<Student> studentList= studentDao.askStudentList(clname);
        req.setAttribute("studentList", studentList);
        if(req.getParameter("flag")==null)
            req.getRequestDispatcher("sgms/lec_queryStudents.jsp").forward(req, resp);
        else
            req.getRequestDispatcher("sgms/lec_setCourseScore.jsp").forward(req, resp);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
